package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.entity.vo.TestUser;
import com.entity.vo.TestUserListVo;

@Controller
public class TestFmController {
	@RequestMapping("/testFm")
	public String toFm( TestUser user,Model model){
		
		System.out.println(user.getUserName());
		System.out.println(user.getUserPwd());
		System.out.println(user.getRole().getRoleName());
		
		return "fm";
	}
	
	@RequestMapping("/testFmList")
	public String testFmList( TestUserListVo users,Model model){
		
		for ( TestUser user : users.getUsers()) {
			
			System.out.println(user.getUserName());
			System.out.println(user.getUserPwd());
			System.out.println(user.getRole().getRoleName());
			System.out.println();
		}
		
		return "fm";
	}
	
	@RequestMapping("/testFmAjax")
	public String toFm1(@RequestBody TestUser user,Model model){
		
		System.out.println(user.getUserName());
		System.out.println(user.getUserPwd());
		System.out.println(user.getRole().getRoleName());
		
		return "fm";
	}
	
	@RequestMapping("/testFmListAjax")
	public String testFmList1(@RequestBody TestUserListVo users,Model model){
		
		for ( TestUser user : users.getUsers()) {

			System.out.println(user.getUserName());
			System.out.println(user.getUserPwd());
			System.out.println(user.getRole().getRoleName());
			System.out.println();
		}
		
		return "fm";
	}
}
